package com.zhang.learn.swagger.controller;

import com.zhang.learn.swagger.annotation.MySwaggerIgnore;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanghaolian
 * @date 2021/6/3 20:16
 */
@RestController
@RequestMapping("/myController")
@Slf4j
@Api(value = "MyController测试")
public class MyController {

    @GetMapping("/hello")
    public String hello(String name) {
        log.info("hello {}",name);
        return "hello " + name;
    }

    /**
     * swagger 生成的文档中不包含这个方法
     */
    @MySwaggerIgnore
    public void testSwaggerIgnore() {
        log.info("this method is swagger ignored");
    }
}
